/*
 * snmp_packet.h
 *
 *  Created on: 2015-7-13
 *      Author: root
 */

#ifndef SNMP_PACKET_H_
#define SNMP_PACKET_H_
#include"PublicTool.h"
#define USE_SYS_IFINDEX 0
typedef struct _SNMPSYSPACKET{
int     request_id;//请求ID
char    sysDescr[256];//1.3.6.1.2.1.1.1.0
char    sysObjectID[256];//1.3.6.1.2.1.1.2.0
uint32_t sysUpTimeInstance;//1.3.6.1.2.1.1.3.0
char    sysContact[256];//1.3.6.1.2.1.1.4.0
char    sysName[256];//1.3.6.1.2.1.1.5.0
char    sysLocation[256];//1.3.6.1.2.1.1.6.0
uint32_t sysServices;//1.3.6.1.2.1.1.7.0
uint32_t ipForwarding;//1.3.6.1.2.1.4.1.0
uint32_t ifNumber;//1.3.6.1.2.1.2.1.0
uint32_t ipv6Forwarding;//1.3.6.1.2.1.55.1.1.0
uint32_t ipCidrRouteNumber;//1.3.6.1.2.1.4.24.3.0
uint32_t inetCidrRouteNumber;//1.3.6.1.2.1.4.24.6.0
uint32_t ipv6RouteNumber;//1.3.6.1.2.1.55.1.9.0
//没啥用处
#if USE_SYS_IFINDEX
uint32_t ifIndex;//1.3.6.1.2.1.4.20.1.2.IP
#endif
char    softVersion[64];
char    ProductName[32];
char    Manufacturer[12];
int     snmptime;//耗时
}SNMPSYSPACKET;
typedef std::map<std::string,SNMPSYSPACKET>MAPSNMPSYSPACKET;
//返回包大小
int MakeSnmpSysPacket(char*Packet,const char*communtiy,int request_id,const char*IP);
//正确返回0，错误返回错误ID，非法返回-1
int ReadSnmpSysPacket(const char*Packet,int DataSize,SNMPSYSPACKET*Info);
#endif /* SNMP_PACKET_H_ */
